<!-- 状态管理工具使用 -->
<template>
    <div class="h3">
        <h3>pinia使用</h3>
            <p>store.name : {{ store.name }}</p>
            <p>store.counter : {{ store.counter }}</p>
            <p>store.getters : {{ store.addFn(10) }}</p>
        
        <a-button type="primary" @click="fn" style="margin-right:20px">修改内容</a-button>
        <a-button type="primary" @click="reset">重置</a-button>
    </div>
</template>

<script setup lang='ts'>
import {useStore} from '@/store/index'
const store = useStore()
const fn = () => {
    store.modifyName("李四")
}
const reset = () => {
    store.$reset()
}
</script>

<style lang='less' scoped>


</style>